<?php
namespace app\common\validate;

use think\Validate;

class UserPermissionValidate extends Validate{
    protected $rule = [
        'name'=>'require',    //名称可以相同 因为有分组
        'mark'=>'require|unique:user_permission', //unique的配置后面必须带上表名
        'group'=>'require',
        'status'=>''
    ];

    protected $message = [
        'mark.unique'=>'权限标识必须唯一',
    ];

    protected $scene = [
        'add' => ['name','mark'],
        'edit'=> ['name','mark'],
    ];
}

